home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Multimedia / Resource Library: Multimedia.iso / hypercrd / frtxt103.hqx / master FT v1.03 / Free Text Browser v1.03 / stack_-1.xml < prev   
Extensible Markup Language  |  1992-05-20  |  9KB  |  25 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in.03</name>
  5.     <id>-1</id>
  6.     <cardCount>4</cardCount>
  7.     <cardID>2966</cardID>
  8.     <listID>4528</listID>
  9.     <cantModify><false /></cantModify>
  10.     <cantDelete><false /></cantDelete>
  11.     <cantAbort><false /></cantAbort>
  12.     <cardSize>
  13.         <width>512</width>
  14.         <height>342</height>
  15.     </cardSize>
  16.     <script>on openStackif the number of this card is 1 thenif field "Text" is empty thenput "Free Text Browser - Copyright ┬⌐ 1990-1992 - Mark Zimmermann" &┬¼return & "Click on the '?' for help." & return &┬¼"This program is free and comes with NO WARRANTY whatsoever!"┬¼into field "Text"end ifend ifinitGlobals    -- set up many things for this stackif item 4 of the screenrect <= 342 then hide menuBarpass openStackend openStackon closeStack-- close out files, vars, empty fields nicelyset cursor to watchlock screenrepeat for the number of cards -- close all database filesif the short name of this bkgnd is "BrowserBg" then closeDatabasego to next cardend repeatshow menuBarpass closeStackend closeStackon closeDatabase-- called before opening a file as well as when leaving the stackget openCloseFiles (getTextFileRefNum(), getKeyFileRefNum(),┬¼getPtrFileRefNum())if not (getSubsetHandle(1) = 0 or getSubsetHandle(1) = empty) thenget zbrowser ("RELEASESUBSET", getSubsetHandle(1))setSubsetHandle 1,0end ifif not (getSubsetHandle(2) = 0 or getSubsetHandle(2) = empty) thenget zbrowser ("RELEASESUBSET", getSubsetHandle(2))setSubsetHandle 2,0end ifput empty into field "FTVars"put empty into field "Index1"put empty into field "Index2"put empty into field "Context"put empty into field "Text"put empty into field "Database Name"if the height of field "Text" > 169 thensend mouseUp to bg button id 44end ifhide field "searchPattern1"hide field "searchPattern2"hide bg button "and subsets"hide bg button "or subsets"hide bg button "not subset 1"hide bg button "not subset 2"hide bg button "fill subset 1"hide bg button "fill subset 2"end closeDatabaseon initGlobals-- initialize many things here for the stack to use globallyglobal indexLines, contextLines, maxIndexSampleCount,┬¼indexCountWidth, indexKeyWidth, contextLineLength, contextWordOffset,┬¼maxContextLinesSkipped, textChunkSize, textOffset, errorCount,┬¼contextGutterWidth, whichSubsetput 7 into indexLines -- hold this many lines in Index fieldsput 7 into contextLines -- hold this many lines in Context fieldput 100 into maxIndexSampleCount -- sample size during subset countsput 5 into indexCountWidth -- this many digits of count info for Indexput 28 into indexKeyWidth -- this many letters of Index wordsput 80 into contextLineLength -- this many letters of Contextput 35 into contextWordOffset -- key word starts in this columnput 100 into maxContextLinesSkipped-- make a line of dots after this many lines in subset are skippedput 8192 into textChunkSize -- grab this much for text fieldput 4096 into textOffset -- put key word this far into text chunkput 0 into errorCount -- initialize counter to control error displayput 0 into contextGutterWidth -- spaces before key wordput 1 into whichSubset -- identify which subset, 1 or 2, is being usedend initGlobalson checkOpenDatabase-- test to catch attempt to operate without an open indexed file;-- try turning it into an "Open Database" request if so!if (getTextFileRefNum() = 0  or getTextFileRefNum() = empty) thenbeepanswer "No database open!"exit to HyperCardend ifend checkOpenDatabasefunction clickedLineNum-- compute which line number of the field got the clickreturn 1 + trunc((item 2 of the clickLoc - (item 2 of (the rectangle┬¼of the target))) / (the textheight of the target))end clickedLineNumfunction clickedOnLeftHalf-- see if click was on left half of the button, for AND and OR subsetsput item 1 of the clickLoc into clickXput ((item 1 of the rect of the target) + (item 3 of the rect of the┬¼target)) / 2 into midPointXreturn (clickX < midPointX)end clickedOnLeftHalfon browseIndex1-- fill Index field #1global indexLines, maxIndexSampleCount, indexCountWidth, indexKeyWidthget zbrowser ("INDEX", getwordnum1(), indexLines,┬¼maxIndexSampleCount, indexCountWidth, indexKeyWidth,┬¼getKeyFileRefNum(), getPtrFileRefNum(), getSubsetHandle(1))put line 1 to indexLines of It into field "Index1"setInstanceList1 (line (indexLines+1) to (2*indexLines) of It)end browseIndex1on browseIndex2-- fill Index field #2global indexLines, maxIndexSampleCount, indexCountWidth, indexKeyWidthget zbrowser ("INDEX", getwordnum2(), indexLines,┬¼maxIndexSampleCount, indexCountWidth, indexKeyWidth,┬¼getKeyFileRefNum(), getPtrFileRefNum(), getSubsetHandle(2))put line 1 to indexLines of It into field "Index2"setInstanceList2 (line (indexLines+1) to (2*indexLines) of It)end browseIndex2on browseContext lineOffset-- fill the Context fieldglobal contextLines, contextLineLength, contextWordOffset,┬¼maxContextLinesSkipped, contextGutterWidth, whichSubsetget zbrowser ("CONTEXT", getInstanceNum(), contextLines,┬¼lineOffset, contextLineLength, contextWordOffset,┬¼maxContextLinesSkipped, contextGutterWidth, getPtrFileRefNum(),┬¼getTextFileRefNum(), getSubsetHandle(whichSubset))put line 1 to contextLines of It into field ContextsetTextPtrList (line (contextLines+1) to (2*contextLines) of It)end browseContext---- the remaining functions set and fetch values of various useful-- quantities; do it this way to hide the details of how things are-- stored....--function getTextFileRefNumreturn line 1 of field FTVarsend getTextFileRefNumon setTextFileRefNum refNumput refNum into line 1 of field FTVarsend setTextFileRefNumfunction getKeyFileRefNumreturn line 2 of field FTVarsend getKeyFileRefNumon setKeyFileRefNum refNumput refNum into line 2 of field FTVarsend setKeyFileRefNumfunction getPtrFileRefNumreturn line 3 of field FTVarsend getPtrFileRefNumon setPtrFileRefNum refNumput refNum into line 3 of field FTVarsend setPtrFileRefNumfunction getWordNum1return line 4 of field FTVarsend getWordNum1on setWordNum1 wordNumput wordNum into line 4 of field FTVarsend setWordNum1function getWordNum2return line 5 of field FTVarsend getWordNum2on setWordNum2 wordNumput wordNum into line 5 of field FTVarsend setWordNum2function getInstanceNumreturn line 6 of field FTVarsend getInstanceNumon setInstanceNum instanceNumput instanceNum into line 6 of field FTVarsend setInstanceNumfunction getTextStartreturn line 7 of field FTVarsend getTextStarton setTextStart textStartput textStart into line 7 of field FTVarsend setTextStartfunction getTextTargetreturn line 8 of field FTVarsend getTextTargeton setTextTarget textTargetput textTarget into line 8 of field FTVarsend setTextTargetfunction getTextEndreturn line 9 of field FTVarsend getTextEndon setTextEnd textEndput textEnd into line 9 of field FTVarsend setTextEndfunction getSubsetHandle subsetNumberreturn line 9+subsetNumber of field FTVarsend getSubsetHandleon setSubsetHandle subsetNumber, handleput handle into line 9+subsetNumber of field FTVarsend setSubsetHandlefunction getNeighborhoodSizereturn line 12 of field FTVarsend getNeighborhoodSizeon setNeighborhoodSize sizeput size into line 12 of field FTVarsend setNeighborhoodSize-- lines 13 through 19 of field FTVars are currently unusedfunction getInstanceList1item instanceNumreturn line 19+instanceNum of field FTVarsend getInstanceList1itemon setInstanceList1 instanceListglobal indexLinesput instanceList into line 20 to 19+indexLines of field FTVarsend setInstanceList1function getInstanceList2item instanceNumglobal indexLinesreturn line 19+indexLines+instanceNum of field FTVarsend getInstanceList2itemon setInstanceList2 instanceListglobal indexLinesput instanceList into line 20+indexLInes to 19+2*indexLines┬¼of field FTVarsend setInstanceList2function getTextPtrListInstanceItem itemNumglobal indexLines, contextLinesreturn word 1 of line 19+2*indexLines+itemNum of field FTVarsend getTextPtrListInstanceItemfunction getTextPtrListPtrItem itemNumglobal indexLines, contextLinesreturn word 2 of line 19+2*indexLines+itemNum of field FTVarsend getTextPtrListPtrItemon setTextPtrList textPtrListglobal indexLines, contextLinesput textPtrList into line 20+2*indexLInes to 19+2*indexLines┬¼+contextLines of field FTVarsend setTextPtrList</script>
  17.     <background id="2368" file="background_2368.xml" name="NotesBg" />
  18.     <background id="2734" file="background_2734.xml" name="BrowserBg" />
  19.     <background id="4795" file="background_4795.xml" name="PictureBg" />
  20.     <card id="2966" file="card_2966.xml" marked="false" name="FirstBrowserCard" owner="2734" />
  21.     <card id="3576" file="card_3576.xml" marked="false" name="BrowserCard" owner="2734" />
  22.     <card id="3713" file="card_3713.xml" marked="false" name="NotesCard" owner="2368" />
  23.     <card id="5100" file="card_5100.xml" marked="false" name="pictureCard" owner="4795" />
  24. </stack>
  25.